" vim:ft=vim

# related: #115
Execute(Set g:floaterm_width and g:floaterm_height):
  let g:floaterm_height = 0.6
  let g:floaterm_width = 0.6
  let columns_origin = &columns

Execute(FloatermNew):
  FloatermNew
  AssertEqual b:floaterm_opts.width, 0.6
  AssertEqual float2nr(0.6*&columns), winwidth(0)
  AssertEqual b:floaterm_opts.height, 0.6
  AssertEqual float2nr(0.6*(&lines - &cmdheight - 1)), winheight(0)

Execute(FloatermHide and change `&columns`):
  FloatermHide
  let &columns = float2nr(&columns/2)

Execute(FloatermShow: reopen it):
  FloatermShow
  AssertEqual b:floaterm_opts.width, 0.6
  AssertEqual float2nr(0.6*&columns), winwidth(0)
  AssertEqual b:floaterm_opts.height, 0.6
  AssertEqual float2nr(0.6*(&lines - &cmdheight - 1)), winheight(0)

Execute(Restore `&columns`):
  let &columns = columns_origin

Execute(Exit):
  stopinsert
  FloatermKill!
  sleep 100m
